<template>
  <AvicModal :visible="true" title="编辑" width="960px" height="520px" :centered="true" @cancel="closeModal">
    <a-spin :spinning="loading">
      <a-form ref="formRef" :model="form" :rules="rules" v-bind="layout" layout="horizontal">
        <a-row :gutter="16">
          <a-col v-bind="colLayout.cols">
            <a-form-item name="medthonName" label="方法名">
              <a-input
                v-model:value="form.medthonName"
                :max-length="200"
                :auto-focus="true"
                placeholder="请输入方法名"
              />
            </a-form-item>
          </a-col>
          <a-col v-bind="colLayout.cols">
            <a-form-item name="fileUrl" label="文件路径">
              <a-input v-model:value="form.fileUrl" :max-length="65535" placeholder="请输入文件路径" />
            </a-form-item>
          </a-col>
          <a-col v-bind="colLayout.cols">
            <a-form-item name="fileType" label="文件类型">
              <a-input v-model:value="form.fileType" :max-length="100" placeholder="请输入文件类型" />
            </a-form-item>
          </a-col>
          <a-col v-bind="colLayout.cols">
            <a-form-item name="moduleName" label="模块名">
              <a-input v-model:value="form.moduleName" :max-length="200" placeholder="请输入模块名" />
            </a-form-item>
          </a-col>
          <a-col v-bind="colLayout.cols">
            <a-form-item name="fileName" label="文件名">
              <a-input v-model:value="form.fileName" :max-length="200" placeholder="请输入文件名" />
            </a-form-item>
          </a-col>
          <a-col v-bind="colLayout.cols">
            <a-form-item name="status" label="下载状态">
              <a-input v-model:value="form.status" :max-length="50" placeholder="请输入下载状态" />
            </a-form-item>
          </a-col>
          <a-col v-bind="colLayout.cols">
            <a-form-item name="remark" label="备注">
              <a-input v-model:value="form.remark" :max-length="65535" placeholder="请输入备注" />
            </a-form-item>
          </a-col>
          <a-col v-bind="colLayout.cols">
            <a-form-item name="saveType" label="保存类型">
              <a-input v-model:value="form.saveType" :max-length="100" placeholder="请输入保存类型" />
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
    <template #footer>
      <a-button title="保存" type="primary" :loading="loading" @click="saveForm">保存</a-button>
      <a-button title="返回" type="primary" ghost @click="closeModal">返回</a-button>
    </template>
  </AvicModal>
</template>
<script lang="ts" setup>
import { useSysDownloadFilesForm, emits } from './ts/SysDownloadFilesForm'; // 引入表单ts
const props = defineProps({
  formId: {
    type: String,
    default: ''
  }
});
const emit = defineEmits(emits);
const { form, formRef, rules, layout, colLayout, loading, saveForm, closeModal } = useSysDownloadFilesForm({
  props,
  emit
});
</script>
